<h2><?php 
	echo '<b>' . $this->man['name_' .$this->locale ] . '</b>';
?></h2>
<div class="content">

	<div class="contentcolumn">
		<div class="boximages">
			<div class="image"><img src="<?php echo $this->File( $this->man['logo'], 200 ) ?>" /></div>
		</div>
		<div class="text">
		<?php echo $this->man['description_' . $this->locale ] ?>
		</div>
	<div class="clr"></div>
	</div>
	
</div>


<?php if( ( $this->sort == 'price' ) && ( !$this->emptyResult ) ) {
	$list = array();
	
	if( $this->page < 2 ) {
		$start = 1;
		$stop = 12;
	} else {
		$start = ( $this->page - 1 ) * $this->limit;
		$stop = $this->page * $this->limit;
	}

	$limit =  $this->page;
	$i = 1;
	
	foreach( $this->list2  as $value ) {
		$free = $this->Findfree( $value['Dimension'] );
		$list[$this->Price( $value, $free, $this->locale ) . $value['p_id']] = $value;
		
		//echo $this->Price( $value, $free, $this->locale ). '.' .$value['p_id'] . '<br />';
	}
//die(1);
	if( $this->sort_direction == 'desc' ) {
		krsort( $list );
	} else {
		ksort( $list );
	}
	
	foreach( $list as $value ) {
		if( $i >= $start && $i <= $stop ) {
			$listTemp[] = $value;
		}
		$i++;
	}
	//echo $i;
	$list = $listTemp;
} else {
	$list = $this->list;
}
	
?>
<div class="sorting">
	<div class="text">
		<?php echo $this->translate( 'sortby' ) ?> : 
	
		<?php if( $this->sort == 'name' ) { ?>
			<a class="cyellow" href="<?php echo $this->baseUrl() ?>/shop/producer/id/<?php echo $this->id ?>/p/<?php echo $this->parent ?>/sort/name/sd/<?php echo ( $this->sort_direction == 'asc' ) ? 'desc' : 'asc'; ?>"><?php echo ( $this->sort_direction == 'asc' ) ? '&#9650;' : '&#9660;'; ?> <?php echo $this->translate( 'sortby_name' ) ?></a>
		<?php } else { ?>
			<a href="<?php echo $this->baseUrl() ?>/shop/producer/id/<?php echo $this->id ?>/p/<?php echo $this->parent ?>/sort/name/sd/asc"><?php echo $this->translate( 'sortby_name' ) ?></a>
		<?php } ?>
		 | 
		<?php if( $this->sort == 'price' ) { ?>
			<a class="cyellow" href="<?php echo $this->baseUrl() ?>/shop/producer/id/<?php echo $this->id ?>/p/<?php echo $this->parent ?>/sort/price/sd/<?php echo ( $this->sort_direction == 'asc' ) ? 'desc' : 'asc'; ?>"><?php echo ( $this->sort_direction == 'asc' ) ? '&#9650;' : '&#9660;'; ?> <?php echo $this->translate( 'sortby_price' ) ?></a>
		<?php } else { ?>
			<a href="<?php echo $this->baseUrl() ?>/shop/producer/id/<?php echo $this->id ?>/p/<?php echo $this->parent ?>/sort/price/sd/asc"><?php echo $this->translate( 'sortby_price' ) ?></a>
		<?php } ?>
	</div>
</div>


<?php if( $this->emptyResult ) { ?>
	<div class="content">
		<?php echo $this->translate( 'products_empty_result' ); ?>
	</div>
<?php } else { ?>
		
	<?php $i = 0; foreach( $list as $value ) { ?>

		<?php $free = $this->Findfree( $value['Dimension'] ); ?>

		<div class="content<?php echo ( $i > 0 ) ? ' mtop5' : '' ?>">
		
			<div class="contentcolumn">
				<div class="boximages1">
					<div class="image1over">
						<div class="image1" style="background: url(<?php echo $this->File( $value['Galeries']['Photos']->toArray(), 220 ) ?>) center center no-repeat">
	        			</div>
        			</div>
				</div>
				<div class="text1">
					<h4><a href="<?php echo $this->baseUrl() ?>/shop/item/id/<?php echo $value['p_id'] ?>/<?php echo $this->Seo( $value['name_' . $this->locale] ) ?>"><?php echo $value['name_' . $this->locale] ?></a><span class="price"><?php echo $this->Price( $value, $free, $this->locale, true ) ?></span></h4>
					<?php 
						echo substr( $value['description_' . $this->locale], 0, 350 ) . ' <p class="cw"><a href="' . $this->baseUrl() . '/shop/item/id/' . $value['p_id'] . '/' . $this->Seo( $value['name_' . $this->locale] ) .'">' . $this->translate( 'read_all' ) . '</a></p>';
					?>
					<div class="mtop20">
						<?php if( $value['Dimension'][$free]['stock'] > 0 ) { ?>
							<div class="fleft"><table><tr><td><img src="<?php echo $this->baseUrl(); ?>/public/images/kwgreen.jpg" alt=""></td><td><?php echo $this->translate( 'product_available' ); ?></td></tr></table></div>
							
							<a id="addbutton" href="<?php echo $this->baseUrl() ?>/shop/basket/add/<?php echo $value['p_id'] ?>/dem/<?php echo $value['Dimension'][$free]['d_id'] ?>" class="button4 fright"><?php echo $this->translate( 'add_to_basket' ) ?></a>
						<?php } else { ?>
							<div class="fleft"><table><tr><td><img src="<?php echo $this->baseUrl(); ?>/public/images/kwred.jpg" alt=""></td><td><?php echo $this->translate( 'product_not_available' ); ?></td></tr></table></div>
						<?php } ?>
					</div>
				</div>
			<div class="clr"></div>
			</div>
			
		</div>

	<?php $i++; } ?>
<?php echo $this->render('global/pager_service.phtml'); ?>

<?php } ?>